//测试——哈希表
//编译：g++ TestHashTable.cpp ../../*/*/HashTable.hpp ../../*/ExceptionDefinition.hpp -o test
#ifndef __TESTHASHTABLE__CPP
#define __TESTHASHTABLE__CPP

#include<iostream>
#include"../../DataStructure/HashTable/HashTable.hpp"
#include"../../DataStructure/ExceptionDefinition.hpp"

using namespace std;
using namespace NgSiuKei;

int main(void) {
    cout << "初始化" << endl;
    HashTable<U_L_L> hashTable;
    hashTable.print();

    cout << "塞入数据" << endl;
    for(U_L_L i=0; i<MAX_SIZE*5; ++i) {
        hashTable.setVal(i, i);
    }
    hashTable.print();

    cout << "getVal(" << MAX_SIZE/2 << ") = " << hashTable.getVal(MAX_SIZE/2) << endl;
    cout << "getVal(" << MAX_SIZE*2+1 << ") = " << hashTable.getVal(MAX_SIZE*2+1) << endl;

    cout << "改" << MAX_SIZE/2 << "和" << MAX_SIZE*2+1 << endl;
    hashTable.setVal(MAX_SIZE/2, 555);
    hashTable.setVal(MAX_SIZE*2+1, 547);
    hashTable.print();

    cout << "删除" << MAX_SIZE/2 << "和" << MAX_SIZE*2+1 << endl;
    hashTable.deleteVal(MAX_SIZE/2);
    hashTable.deleteVal(MAX_SIZE*2+1);
    hashTable.print();

    return 0;
}

#endif